<?php
class kucun_areaControl extends skymvc{
	
	public function __construct(){
		parent::__construct();
	}
	
	public function onDefault(){
		$data=M("kucun_area")->select(array(
			"where"=>" kcid=".SHOPID
		));
		if($data){
			foreach($data as $k=>$v){
				$shopids[]=$v['siteid'];
			}
			$shops=M("sites")->getByIds($shopids);
			foreach($data as $k=>$v){
				$shop=$shops[$v['siteid']];
				$v=$shop;
				$data[$k]=$v;
			}
		}
		$this->smarty->assign(array(
			"data"=>$data
		));
		
		$this->smarty->display("kucun_area/index.html");	
	}
	
}

?>